/***************************************************************
 * Name:      CB-Plugin
 * Purpose:   Code::Blocks plugin
 * Author:     ()
 * Created:   2009-02-02
 * Copyright:
 * License:   GPL
 **************************************************************/

#ifndef PropertiesManager_H_INCLUDED
#define PropertiesManager_H_INCLUDED

// For compilers that support precompilation, includes <wx/wx.h>
#include <wx/wxprec.h>

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include <cbplugin.h> // for "class cbPlugin"
#include "projectmanager.h"
//#include "FileExplorer.h" // provides the FileExplorer class

class PropertiesManagerPlugin : public cbPlugin
{
    public:
        PropertiesManagerPlugin();
        virtual ~PropertiesManagerPlugin();

    protected:
        virtual void BuildMenu(wxMenuBar* /*menuBar*/) {}
        virtual void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0);
        virtual bool BuildToolBar(wxToolBar* /*toolBar*/) {return false;}
        virtual void OnAttach();
        virtual void OnRelease(bool appShutDown);
        void OnOpenProjectInFileBrowser(wxCommandEvent& event);
        void OnRebuildTree(CodeBlocksEvent& event);
        void OnRightClick(wxTreeEvent &event);
        void OnExpand(wxTreeEvent &event);
        void OnTreeItemRightClick(wxTreeEvent& event);
        void ShowMenu(wxTreeItemId id, const wxPoint& pt);
        void OnAddNewProjectProperties(wxCommandEvent& event);
        void OnAddOldProjectProperties(wxCommandEvent& event);
        void OnSaveProjectProperties(wxCommandEvent& event);
        void OnRenameProjectProperties(wxCommandEvent& event);
        void OnProjectProperties(wxCommandEvent& event);
        void OnRemoveTarget(wxCommandEvent& event);
        void RebuildTree();
        void FreezeTree();
        void UnfreezeTree(bool force = false);


    private:
        cbTreeCtrl* m_pTree;
        std::unique_ptr<wxImageList> m_pImages;
        wxString m_project_selected;
          wxTreeItemId         m_RightClickItem;
DECLARE_EVENT_TABLE();
};

#endif // PropertiesManager_H_INCLUDED
